<!--#include file="../core/common/Conn.asp" -->
<%
	dim action
	action = request.QueryString("action")
	if action = "logout" then
		call logout
	else
		call default
	end if
	
	dim NAME
	
	'加载默认数据
	sub default
		dim USERNAME,PASSWORD
		USERNAME = request.Cookies("USERINFO")("USERNAME")
		PASSWORD = request.Cookies("USERINFO")("PASSWORD")
		
		dim rs,sql
		sql = "select * from USERS where USERNAME = '"& USERNAME &"' and PASSWORD = '"& PASSWORD &"'"
		set rs = db.query(sql)
		if not rs.eof then
			NAME = rs("NAME")
		end if
		rs.close
		set rs = nothing
	end sub
	
	'注销
	sub logout
		response.Cookies("USERINFO").expires = date - 1
		response.Write("<script type='text/javascript'>parent.location.href='login.asp';</script>")
		response.End()
	end sub
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CMSLite for ASP</title>
<link href="resource/css/reset.css" rel="stylesheet" type="text/css" />
<link href="resource/css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="resource/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
	jQuery(function($){
		var _selected = "selected";
		var menu1 = $(".menu1 > ul > li > a");
		var menu2 = $(".menu2 > ul");
		var menu2_btn = $(".menu2 > ul > li > a");

		menu1.first().addClass(_selected);
		menu2.first().addClass(_selected);

		menu1.each(function(i){
			this.onclick = function(){
				menu1.removeClass(_selected);
				menu2.removeClass(_selected);
				$(menu1.get(i)).addClass(_selected);
				$(menu2.get(i)).addClass(_selected);
			}
		});
		
		menu2_btn.each(function(i){
			this.onclick = function(){
				menu2_btn.removeClass(_selected);
				$(menu2_btn.get(i)).addClass(_selected);
			}
		}).attr("target","mainFrame");
	});
</script>
</head>

<body>
	<div id="head">
		<div class="menu1">
			<ul>
				<li><a href="#">内容管理</a></li>
				<li><a href="#">用户管理</a></li>
				<li><a href="#">栏目管理</a></li>
				<li><a href="#">高级设置</a></li>
			</ul>
			<div>当前用户：<a href="#"><%=NAME%></a> [<a href="?action=logout">注销</a>]</div>
		</div>
		<div class="menu2">
			<ul>
				<li><a href="./subject/subject.asp"><span>栏目列表</span></a></li>
			</ul>
			<ul>
				<li><a href="./user/personal.asp"><span>个人设置</span></a></li>
				<li><a href="./user/list.asp"><span>用户列表</span></a></li>
			</ul>
			<ul>
				<li><a href="./subject/list.asp"><span>栏目列表</span></a></li>
				<li><a href="./module/list.asp"><span>栏目类型</span></a></li>
			</ul>
			<ul>
				<li><a href="javascript:void(0)"><span>页面4</span></a></li>
				<li><a href="javascript:void(0)"><span>页面4</span></a></li>
			</ul>
		</div>
	</div>
</body>
</html>
